/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.minam.beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "TDEPARTAMENTOS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tdepartamentos.findAll", query = "SELECT t FROM Tdepartamentos t"),
    @NamedQuery(name = "Tdepartamentos.findByCodiDepaDpt", query = "SELECT t FROM Tdepartamentos t WHERE t.codiDepaDpt = :codiDepaDpt"),
    @NamedQuery(name = "Tdepartamentos.findByNombDptoDpt", query = "SELECT t FROM Tdepartamentos t WHERE t.nombDptoDpt = :nombDptoDpt")})
public class Tdepartamentos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "CODI_DEPA_DPT")
    private String codiDepaDpt;
    @Size(max = 50)
    @Column(name = "NOMB_DPTO_DPT")
    private String nombDptoDpt;

    public Tdepartamentos() {
    }

    public Tdepartamentos(String codiDepaDpt) {
        this.codiDepaDpt = codiDepaDpt;
    }

    public String getCodiDepaDpt() {
        return codiDepaDpt;
    }

    public void setCodiDepaDpt(String codiDepaDpt) {
        this.codiDepaDpt = codiDepaDpt;
    }

    public String getNombDptoDpt() {
        return nombDptoDpt;
    }

    public void setNombDptoDpt(String nombDptoDpt) {
        this.nombDptoDpt = nombDptoDpt;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codiDepaDpt != null ? codiDepaDpt.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tdepartamentos)) {
            return false;
        }
        Tdepartamentos other = (Tdepartamentos) object;
        if ((this.codiDepaDpt == null && other.codiDepaDpt != null) || (this.codiDepaDpt != null && !this.codiDepaDpt.equals(other.codiDepaDpt))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.minam.beans.Tdepartamentos[ codiDepaDpt=" + codiDepaDpt + " ]";
    }
    
}
